﻿using System;
using System.Collections.Generic;

namespace School
{
    class Course
    {
        private Dictionary<int, Student> studentsInTheCourse;

        public Dictionary<int, Student> StudentsInTheCourse
        {
            get
            {
                return studentsInTheCourse;
            }
            set
            {
                studentsInTheCourse = value;
            }
        }

        public Course()
        {
            studentsInTheCourse = new Dictionary<int, Student>();
        }

        public void Add(Student student)
        {
            if (studentsInTheCourse.ContainsKey(student.FacultyNumber))
            {
                throw new ArgumentException();
            }
            if (studentsInTheCourse.Count == 30)
            {
                throw new IndexOutOfRangeException();
            }
            studentsInTheCourse.Add(student.FacultyNumber, student);
        }
    }
}